using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace MusicEvolution.Database
{
	public class Track : DataBaseRow
	{
		DataField _Bitrate;
		DataField _Disc;
		DataField _isRemix;
		DataField _Length;
		DataField _Number;
		DataField _Rating;
		DataField _SampleRate;
		DataField _Size;
		DataField _TimeAdded;
		DataField _Title;
		DataField _Total_Disc;
		DataField _Total_Number;
		DataField _Year;
		DataField _Genre;
		DataField _Lyrics;
		DataField _Share;
		DataField _Composer;
		DataField _Artist;

        public Track()
        {
            _Artist = new DataField("Artist", "");
            _Composer = new DataField("Composer", "");
            _Share = new DataField("Share", "");
            _Lyrics = new DataField("Lyrics", "");
            _Genre = new DataField("Genre", "");
            _Year = new DataField("Year", "");
            _Total_Number = new DataField("Total_Number", "");
            _Total_Disc = new DataField("Total_Disc", "");
            _Title = new DataField("Title", "");
            _TimeAdded = new DataField("TimeAdded", "");
            _Size = new DataField("Size", "");
            _isRemix = new DataField("isRemix", "");
            _Length = new DataField("length", "");
            _Number = new DataField("number", "");
            _Rating = new DataField("Rating", "");
            _SampleRate = new DataField("SampleRate", "");
            _Disc = new DataField("Disc", "");
            _Bitrate = new DataField("Bitrate", "");

            base.Add(_Artist);
            base.Add(_Composer);
            base.Add(_Share);
            base.Add(_Lyrics);
            base.Add(_Genre);
            base.Add(_Year);
            base.Add(_Total_Number);
            base.Add(_Total_Disc);
            base.Add(_Title);
            base.Add(_TimeAdded);
            base.Add(_Size);
            base.Add(_isRemix);
            base.Add(_Length);
            base.Add(_Rating);
            base.Add(_Number);
            base.Add(_SampleRate);
            base.Add(_Disc);
            base.Add(_Bitrate);

        }

		public int BitRate
		{
			get
			{
                return Convert.ToInt32(_Bitrate.Value);
			}
			set
			{
                _Bitrate.Value = value.ToString();
			}
		}

		public int Disc
		{
			get
			{
                return Convert.ToInt32(_Disc.Value);
			}
			set
			{
                _Disc.Value = value.ToString();
			}
		}

		public bool IsRemix
		{
			get
			{
                return Convert.ToBoolean(_isRemix.Value);
			}
			set
			{
                _isRemix.Value = Convert.ToInt32(value).ToString();
			}
		}

		public int Number
		{
			get
			{
                return Convert.ToInt32(_Number.Value);
			}
			set
			{
                _Number.Value = value.ToString();
			}
		}

		public int SampleRate
		{
			get
			{
                return Convert.ToInt32(_SampleRate.Value);
			}
			set
			{
                _SampleRate.Value = value.ToString();
			}
		}

		public string Title
		{
			get
			{
                return _Title.Value;
			}
			set
			{
                _Title.Value = value;
			}
		}

		public int Total_Disc
		{
			get
			{
                return Convert.ToInt32(_Total_Disc.Value);
			}
			set
			{
                _Total_Disc.Value = value.ToString();
			}
		}

		public int Total_Number
		{
			get
			{
                return Convert.ToInt32(_Total_Number.Value);
			}
			set
			{
                _Total_Number.Value = value.ToString();
			}
		}

		public int Year
		{
			get
			{
                return Convert.ToInt32(_Year.Value);
			}
			set
			{
                _Year.Value = value.ToString();
			}
		}

		public DateTime TimeAdded
		{
			get
			{
                return DateTime.FromFileTime(Convert.ToInt64(_TimeAdded.Value));
			}
			set
			{
                _TimeAdded.Value = value.ToFileTime().ToString();
			}
		}

		public long Artist
		{
			get
			{
                return Convert.ToInt64(_Artist.Value);
			}
			set
			{
                _Artist.Value = value.ToString();
			}
		}

		public long Composer
		{
			get
			{
                return Convert.ToInt64(_Composer.Value);
			}
			set
			{
                _Composer.Value = value.ToString();
			}
		}

		public int Share
		{
			get
			{
                return Convert.ToInt32(_Share);
			}
			set
			{
                _Share.Value = value.ToString();
			}
		}

		public long Lyrics
		{
			get
			{
                return Convert.ToInt64(_Lyrics.Value);
			}
			set
			{
                _Lyrics.Value = value.ToString();
			}
		}

		public long Genre
		{
			get
			{
                return Convert.ToInt64(_Genre.Value);
			}
			set
			{
                _Genre.Value = value.ToString();
			}
		}

        public TimeSpan Length
        {
            get
            {
                return TimeSpan.FromTicks(Convert.ToInt64(_Length.Value));
            }
            set
            {
                _Length.Value = value.Ticks.ToString();
            }
        }

        public int Rating
        {
            get
            {
                return Convert.ToInt32(_Rating.Value);
            }
            set
            {
                _Rating.Value = value.ToString();
            }
        }

        public long Size
        {
            get
            {
                return Convert.ToInt64(_Size.Value);
            }
            set
            {
                _Size.Value = value.ToString();
            }
        }
	}
}
